<?php
$this->pageTitle = Yii::app()->name . " - Add Folder $label";
?>

<h1>Add Folder <?php echo $label; ?></h1>

<div class="form">

	<?php
	$properties = array(
		'id'=>'file-addFolder-form',
		'enableAjaxValidation'=>false,
	);
	$form = $this->beginWidget('CActiveForm', $properties);
	?>

	<p class="note">
		Fields with <span class="required">*</span> are required.
	</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'name');
		echo $form->textField($model, 'name', array('class'=>'fill'));
		echo $form->error($model, 'name');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'path');
		$root = Yii::app()->params['file'];
		$folder = new Folder("$root/$type");
		$data = $folder->listData();
		$htmlOptions = array(
			'encode'=>false,
			'prompt'=>'Root',
			'class'=>'fill'
		);
		echo $form->dropDownList($model, 'path', $data, $htmlOptions);
		echo $form->error($model, 'path');
		?>
	</div>


	<div class="row buttons">
		<?php echo CHtml::submitButton('Add Folder'); ?>
	</div>

	<?php $this->endWidget(); ?>

</div><!-- form -->

<?php
if (Yii::app()->user->hasFlash('info')) {
	$options = array(
		'align'=>'right',
		'verticalAlign'=>'top',
		'time'=>3000,
	);
	$message = Yii::app()->user->getFlash('info');
	EjQueryUiTheme::register();
	EFloatingMessage::add($message, $options);
}
?>
